#ifndef __MAP_LAYER_H__
#define __MAP_LAYER_H__
#include "cocos2d.h"
#include <string>
#include <vector>

USING_NS_CC;

namespace gofgame {
	namespace dungeonkeeper {
		namespace mapscene{
			class MapLayer : public CCLayer{
			public:
				bool init(int pageNum);
				int index;
				int pageCount;
				static MapLayer * createMapLayer(int pageNum = 1);
			public:
				void initData(int pageNum);
				struct LevelInfo {
					std::string bgPath;
					std::string infoXmlPath;
					int level_id;
					std::string name;
					std::string desc;
					int finish;
					int level;
					int pos_x;
					int pos_y;
				};
				std::vector<LevelInfo> finishLevelVec;
				LevelInfo currentLevel;

				static int onQueryFinishLevelInfo(void*,int coulmnCount ,char** values,char** columnName);
				static int onQueryCurrentLevelInfo(void*,int coulmnCount ,char** values,char** columnName);
				int onThisQueryLevelInfo(int coulmenCount ,char** values,char** columnName);
				static void dbConvertInfo(LevelInfo *,int coulmnCount ,char** values,char** columnName);
			};
		}
	}
}

#endif //__MAP_LAYER_H__
